<?php
namespace Common\Controller;
use Index\Controller\EmptyController;
class CoreController extends  EmptyController {
	 
   /*
   * 
   *  add+edit
   */
   
   public  function Add($db_arr=null,$con_arr,$tbl_name){
	   
	 
	   
	  if(empty($db_arr)||empty($tbl_name)||empty($con_arr)) return false;
	  
	  
	  if($con_arr['act']=='add'){
		  
		  $db=M($tbl_name);
		  
		  $lastId=!empty($con_arr['id'])?$db->where(array($con_arr['unid']=>$con_arr['id']))->save($db_arr):$db->add($db_arr);
		  
	      if(!empty($lastId)) return $lastId;
 
	  }
	  
	  
	  
	  return false;
   }
   
 
}